package com.aaa.day1104.demo01;

import java.util.function.BiPredicate;
import java.util.function.Predicate;

/**
 * @author ${崔灿}
 * @date 2022/11/04 16:37
 **/

public class TestPredicate {
    public static void main(String[] args) {
        //根据你传递的字符串，判断字符串的长度是否大于5
        //boolean test (T t); 方法体中有且仅有一条语句，返回结果。则可以省略{} 以及return关键字

        Predicate<String> predicate =t->t.length()>5;
        boolean hello = predicate.test("helloew");
        System.out.println(hello);

        //boolean test(T t , U u); Stream流的时候。
        BiPredicate<String,String> biPredicate = (t,u)->t.equals(u);
        boolean test = biPredicate.test("hello","world");
        System.out.println(test);
    }
}
